from django.contrib.auth.mixins import LoginRequiredMixin
from django.views import View
from django import http


class LoginRequiredJsonMixin(LoginRequiredMixin, View):
    """自定义判断用户是否登录的扩展类"""
    def handle_no_permission(self):

        return http.JsonResponse({'code': 400, 'errmsg': '用户未登录'})

